from selenium.webdriver.common.by import By

from base import Base

class Page(Base):
    # 点击搜索
    def page_1(self):
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜商品名称 作者 出版社 ISBN")')
        ele = self.find_ele(loc)
        return ele
    # 输入内容
    def shur_2(self):
        loc = (By.ID,'com.kongfz.app:id/etContent')
        ele = self.find_ele(loc)
        return ele
    # 点击搜索按键
    def sousan_3(self):
        loc = (By.ANDROID_UIAUTOMATOR,'new UiSelector().resourceId("com.kongfz.app:id/tvSearch")')
        ele = self.find_ele(loc)
        return ele
    # 点击图片
    def tupian_4(self):
        loc = (By.XPATH,'(//android.widget.ImageView[@resource-id="com.kongfz.app:id/ivPic"])[3]')
        ele = self.find_ele(loc)
        return ele
    # 点击加入购物车
    def jiargwc_5(self):
        loc = (By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tvAddCart1"]')
        ele = self.find_ele(loc)
        return ele
    # 点击购物车图标
    def guotb_6(self):
        loc = (By.XPATH,'//android.widget.RelativeLayout[@resource-id="com.kongfz.app:id/rlCartIcon"]')
        ele = self.find_ele(loc)
        return ele
    # 点击管理
    def guanli_7(self):
        loc = (By.XPATH,'//android.widget.TextView[@resource-id="com.kongfz.app:id/tv_manage"]')
        ele = self.find_ele(loc)
        return ele

    # 断言全部
    def quanb(self):
        loc = (By.ID,'com.kongfz.app:id/tv_char_all')
        ele = self.find_ele(loc)
        return ele


    # 全选
    def quanua_8(self):
        loc = (By.ID,'com.kongfz.app:id/icon_font_choice_all')
        ele = self.find_ele(loc)
        return ele
    # 点击删除
    def shanc_9(self):
        loc = (By.ID,'com.kongfz.app:id/tv_delete')
        ele = self.find_ele(loc)
        return ele

    def super_10(self):
        loc = (By.CLASS_NAME,'')
        ele = self.find_ele(loc)
        return ele


